package cc.rengu.igas.bsps.common.enums;

/**
 * 验证码类型
 * Created by 王成 on 2018/6/14.
 */
public enum SmsTypeEnum {
    SIGN("00", "用户签约"),
    LOGIN("01", "用户登录"),
    REGISTER("02", "注册"),
    PWD_RESET("03", "密码重置"),
    ACTIVE("04", "密码重置"),
    BIND("05", "绑定"),
    ;
    private String type;
    private String desc;

    SmsTypeEnum(String type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    /**
     * 商户服务验证码类型转换
     *
     * @param smsType 商户服务验证码类型
     * @return 产品内部验证码类型
     */
    public static String changeBspSmsType(String smsType) {
        switch (smsType) {
            case "0":
                return REGISTER.getType();
            case "1":
                return PWD_RESET.getType();
            case "2":
                return SIGN.getType();
            case "3":
                return ACTIVE.getType();
            case "4":
                return BIND.getType();
            default:
                return null;
        }
    }
}
